﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Linq;
using System.Collections.Generic;
using System.Xml;

namespace Triples {
    public class ShapeConverter : IValueConverter {


        public DataTemplate Diamond {
            get;
            set;
        }

        public DataTemplate Oval {
            get;
            set;
        }

        public DataTemplate Squiggle {
            get;
            set;
        }


        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {

            if (value is ICard) {
                ICard card = value as ICard;
                
                switch (card.Shape) {
                    case Shapes.Diamond: return Diamond;
                    case Shapes.Oval: return Oval;
                    case Shapes.Squiggle: return Squiggle;
                    default: break;
                }
            }

            return DependencyProperty.UnsetValue;
        }


        private int GetNumber(ICard card) {
            switch (card.Number) {
                case Numbers.One: return 1;
                case Numbers.Two: return 2;
                case Numbers.Three: return 3;
                default: return 0;
            }
        }


        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            throw new NotImplementedException();
        }
    }
}
